package com.crm.sys.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.crm.base.dao.BaseDao;
import com.crm.sys.dao.SysDao;
import com.crm.sys.model.Announcement;
import com.crm.sys.model.CallLog;
import com.crm.sys.model.City;
import com.crm.sys.model.CityAndProvinceDic;
import com.crm.sys.model.Configure;
import com.crm.sys.model.ConfigureItem;
import com.crm.sys.model.Department;
import com.crm.sys.model.Log;
import com.crm.sys.model.Province;
import com.crm.sys.model.Role;
import com.crm.sys.model.RoleItme;
import com.crm.sys.model.RoleProduct;
import com.crm.sys.model.SysTerm;
@Repository("sysDao")
public class SysDaoImpl  extends BaseDao implements SysDao {

	private static final String MAPPER_NAMESAPCE = "SysMapper.";
	
	@Override
	public List<Province> getProvinceList() {
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getProvinceList"));
		 List<Province> result = jdbcTemplate.query(sql.toString(), new RowMapper<Province>() {  
		      @Override  
		      public Province mapRow(ResultSet rs, int rowNum) throws SQLException {  
		    	  Province prov = new Province();  
		    	  prov.setId(rs.getInt("id"));
		    	  prov.setProvincename(rs.getString("provincename"));
		          return prov;  
		  }});  */
		
		return selectList(MAPPER_NAMESAPCE+"getProvinceList");
	}

	@Override
	public List<City> getCityListByProId(City city) {
		return selectList(MAPPER_NAMESAPCE+"getCityList",city);
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getCityListByProId"));
		List<City> list = jdbcTemplate.query(sql.toString(),new Object[]{proid},new BeanPropertyRowMapper(City .class));
		return list;*/
	}

	
	/**
	 * 城市数据映射
	 * @author Administrator
	 *//*
	protected class CityMapper implements RowMapper{
		@Override
		public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
			City city = new City(); 
			city.setId(rs.getInt("id"));
			city.setCityname(rs.getString("cityname")); 
			city.setProvince(rs.getInt("province"));  
			city.setCitynumber(rs.getString("citynumber"));
			return city;
		}
	}*/
	
	/**
	 * 省份数据映射
	 * @author Administrator
	 */
	/*protected class ProvinceMapper implements RowMapper<Object>{
		@Override
		public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
			Province pro = new Province(); 
			pro.setId(rs.getInt("id"));
			pro.setProvincename(rs.getString("provincename")); 
			return pro;
		}
	}*/

	@Override
	public List<CityAndProvinceDic> getCityList() {
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getCityList"));
		List<CityAndProvinceDic>  resultList = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(CityAndProvinceDic .class));
		return resultList;*/
		return selectList(MAPPER_NAMESAPCE+"getCityAndProvinceList");
	}

	@Override
	public Province insertProvince(Province pro) {
		/*final  String sql = XmlReader.readXml(Constants.SQLFileName,"SysDao_insertProvince");
		KeyHolder keyHolder = new GeneratedKeyHolder();  
		//新增返回主键ID
	    jdbcTemplate.update(new PreparedStatementCreator() {  
	        public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {  
	               PreparedStatement ps = connection.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS);  
	               int i =1;
	               ps.setString(i++,pro.getProvincename());   
	               ps.setString(i++, pro.getProvincenubmer());   
	               return ps;  
	        }  
	    }, keyHolder);  
	    Integer generatedId = keyHolder.getKey().intValue();   
	    pro.setId(generatedId);*/
	    return pro ; 
	}

	@Override
	public City insertCity(final City city) {
		/*final  String sql = XmlReader.readXml(Constants.SQLFileName,"SysDao_insertCity");
		KeyHolder keyHolder = new GeneratedKeyHolder();  
		//新增返回主键ID
	    jdbcTemplate.update(new PreparedStatementCreator() {  
	        public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {  
	               PreparedStatement ps = connection.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS);  
	               int i =1;
	              ps.setObject(i++,city.getProvince());
	              ps.setObject(i++,city.getCityname());
	              ps.setObject(i++,city.getCitynumber());
	               return ps;  
	        }  
	    }, keyHolder);  
	    int generatedId = keyHolder.getKey().intValue();   
	    city.setId(generatedId);*/
	    return city ; 
	}

	@Override
	public Configure getConfigureByName(Configure cf) {
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getConfigureByName"));
		List<Configure>  resultList = jdbcTemplate.query(sql.toString(),new Object[]{code},new BeanPropertyRowMapper(Configure .class));
		return resultList!=null?resultList.get(0):null;*/
		return selectOne(MAPPER_NAMESAPCE+"getConfigureList", cf);
	}

	@Override
	public List<ConfigureItem> getConfigureItemById(ConfigureItem cfi) {
		/*StringBuffer sql = new StringBuffer();
		List<Object> list = new ArrayList<Object>();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getConfigureItemById"));
		if(!Strings.isNullOrEmpty(value)){
			sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getConfigureItem_param"));
			list.add(value);
		}
		if(cid>0){
			sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getConfigureItem_param1"));
			list.add(cid);
		}
		if(pid>0){
			sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getConfigureItem_param2"));
			list.add(pid);
		}
		List<ConfigureItem>  resultList = jdbcTemplate.query(sql.toString(),list.toArray(),new BeanPropertyRowMapper(ConfigureItem .class));
		return resultList;*/
		return selectList(MAPPER_NAMESAPCE+"getConfigureItemList", cfi);
		
	}

	@Override
	public List<Department> getDepartmentAll(Department dp) {
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getDepartment"));
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getDepartmentAll"));
		List<Department>  resultList = jdbcTemplate.query(sql.toString(),new Object[]{pid},new BeanPropertyRowMapper(Department .class));
		return resultList;*/
		
		return selectList(MAPPER_NAMESAPCE+"getDepartmentList", dp);
	}

	@Override
	public Department getDepartmentById(Department dp) {
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getDepartment"));
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getDepartmentById"));
		List<Department>  resultList = jdbcTemplate.query(sql.toString(),new Object[]{id},new BeanPropertyRowMapper(Department .class));
		return resultList!=null?resultList.get(0):null;*/
		return selectOne(MAPPER_NAMESAPCE+"getDepartmentList", dp);
	}

	@Override
	public List<Role> getRoleList(Role role) {
		
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getRoleList"));
		List<Role> list =jdbcTemplate.query(sql.toString() ,new BeanPropertyRowMapper(Role .class));
		return list;*/
		List<Role> list = selectList(MAPPER_NAMESAPCE+"getRoleList",role);
		if (list != null && list.size()>0) {
			list.get(0).setTotalResults((Integer)selectOne(MAPPER_NAMESAPCE+"getRoleListCount", role));
		}
		return list;
	}

	@Override
	public Role insertRole(final Role role) {
		/*final StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_insertRole"));
		KeyHolder keyHolder = new GeneratedKeyHolder();  
		int result =  jdbcTemplate.update(new PreparedStatementCreator() {  
	        public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {  
	               PreparedStatement ps = connection.prepareStatement(sql.toString(),Statement.RETURN_GENERATED_KEYS);  
	               int i=1;
	               ps.setObject(i++, role.getName());  
	               ps.setObject(i++, role.getDescription());    
	               ps.setObject(i++, role.getType()); 
	               ps.setObject(i++, role.getState());
	               ps.setObject(i++, role.getRemark());
	               return ps;  
	        }  
	    },keyHolder);
		 Integer generatedId = keyHolder.getKey().intValue();
		 role.setId(generatedId);*/
		insert(MAPPER_NAMESAPCE+"insertRole", role);
		return role;
	}

	@Override
	public RoleProduct insertRoleProduct(RoleProduct roleproduct) {
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_insertRoleProduct"));
		int result =  jdbcTemplate.update(sql.toString(), new Object[] {
			roleproduct.getRid(),roleproduct.getProductcategory()
		});
		return roleproduct;*/
		insert(MAPPER_NAMESAPCE+"insertRoleProduct", roleproduct);
		return roleproduct;
	}

	@Override
	public Role getRoleByid(Role role) {
		/*StringBuffer sql= new  StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getRoleByid"));
		List<Role> list =jdbcTemplate.query(sql.toString() ,new Object[]{id},new BeanPropertyRowMapper(Role .class));
		return list!=null?list.get(0):null;*/
		return selectOne(MAPPER_NAMESAPCE+"getRoleList",role);
		
	}

	@Override
	public List<RoleProduct> getRoleProductByid(RoleProduct rp) {
		/*StringBuffer sql= new  StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getRoleProductByid"));
		List<RoleProduct> list =jdbcTemplate.query(sql.toString() ,new Object[]{rid},new BeanPropertyRowMapper(RoleProduct .class));
		return list;*/
		return  selectList(MAPPER_NAMESAPCE+"getRoleProductById",rp);
	}

	@Override
	public int deleteRoleProduct(Role role) {
		/*StringBuffer sql= new  StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_deleteRoleProduct"));
		int result =jdbcTemplate.update(sql.toString() ,new Object[]{
			rid
			});
		return result;*/
		return delete(MAPPER_NAMESAPCE+"delRoleProduct", role);
	}

	@Override
	public int updateRole(Role role) {
		
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_updateRole"));
		int result =  jdbcTemplate.update(sql.toString(), new Object[] {
			role.getName(),role.getDescription(),role.getType(),role.getState(),role.getRemark(),role.getId()
		});
		return result;*/
		return update(MAPPER_NAMESAPCE+"updateRole", role);
	}

	@Override
	public List<SysTerm> getSysTermList(SysTerm systerm ) {

		/*StringBuffer sql = new StringBuffer();
		StringBuffer sql1 = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getSysTermList"));
		sql1.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getSysTermListCount"));
		
		//将参数列表转换成数组
		List  params = new ArrayList();
		 List<Object> queryParams= new ArrayList();
		 queryParams.addAll(params);
		 queryParams.add(getBegin(pageNo, pageSize));
		 queryParams.add(pageSize);
		List<SysTerm> list =jdbcTemplate.query(sql.toString() ,new Object[]{systerm.getpId()},new BeanPropertyRowMapper(SysTerm .class));
		if(list!=null&&list.size()>0){
			int  counts = (Integer) jdbcTemplate.queryForObject(sql1.toString(),new Object[]{systerm.getpId()},Integer.class);
			list.get(0).setTotalResults(counts);
		}
		return list;*/
		List<SysTerm> list = selectList(MAPPER_NAMESAPCE+"getSysTermById",systerm);
		if (list != null && list.size()>0) {
			list.get(0).setTotalResults((Integer)selectOne(MAPPER_NAMESAPCE+"getSysTermCountById", systerm));
		}
		return list;
	}

	@Override
	public SysTerm insertSysTerm(SysTerm systerm) {
		
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_insertSysTerm"));
		int result =  jdbcTemplate.update(sql.toString(), new Object[] {
			systerm.getName(),systerm.getUrl(),systerm.getType(),systerm.getpId(),systerm.getRemark(),systerm.getReserve()
		});
		return systerm;*/
		insert(MAPPER_NAMESAPCE+"insertSysTerm", systerm);
		return systerm;
		
	}

	@Override
	public SysTerm getSysTermByid(SysTerm systerm) {
		/*StringBuffer sql= new  StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getSysTermByid"));
		List<SysTerm> list =jdbcTemplate.query(sql.toString() ,new Object[]{id},new BeanPropertyRowMapper(SysTerm .class));
		return list!=null?list.get(0):null;*/
		return selectOne(MAPPER_NAMESAPCE+"getSysTermById",systerm);
	}

	@Override
	public int updateSysTerm(SysTerm systerm) {
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_updateSysTerm"));
		int result =  jdbcTemplate.update(sql.toString(), new Object[] {
			systerm.getName(),systerm.getUrl(),systerm.getType(),systerm.getpId(),systerm.getRemark(),systerm.getReserve(),systerm.getId()
		});
		return result;*/
		return update(MAPPER_NAMESAPCE+"updateSysTerm",systerm);
		
	}

	@Override
	public int updateRoleState(Role role) {
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_updateRoleStateQ"));
		int result =  jdbcTemplate.update(sql.toString(), new Object[] {
			id
		});*/
		role.setState(0);
		return update(MAPPER_NAMESAPCE+"updateRoleState", role);
	}
 

	@Override
	public List<SysTerm> getSysTermBound(int rid) {
		/*StringBuffer sql= new  StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getSysTermBound"));
		List<SysTerm> list =jdbcTemplate.query(sql.toString(), new Object[]{
			rid
		},new BeanPropertyRowMapper(SysTerm .class));
		return list;*/
		
		return  selectList(MAPPER_NAMESAPCE+"getRoleItmeById",rid);
	}

	@Override
	public int deleteSysTermBound(RoleItme ri) {
		
		/*StringBuffer sql= new  StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_deleteSysTermBound"));
		int result =jdbcTemplate.update(sql.toString() ,new Object[]{
			rid
			});
		return result;*/
		return delete(MAPPER_NAMESAPCE+"deleteRoleItme", ri);
	}

	@Override
	public int updateSysTermBound(RoleItme ri) {
		
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_updateSysTermBound"));
		int result =  jdbcTemplate.update(sql.toString(), new Object[] {
			rid,tid
		});
		return result;*/
		return insert(MAPPER_NAMESAPCE+"insertRoleItme", ri);
	}

	@Override
	public List<SysTerm> getMuneAll(SysTerm term) {
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getMuneAll"));
		List<SysTerm> list =jdbcTemplate.query(sql.toString(), new Object[]{uid,
			pid
		},new BeanPropertyRowMapper(SysTerm .class));
		return list;*/
		return selectList(MAPPER_NAMESAPCE+"getMenuAll",term);
	}
	
	@Override
	public List<SysTerm> getMenuByRid(SysTerm term) {
		 
		return selectList(MAPPER_NAMESAPCE+"getMenuByRid",term);
	}
	
	

	@Override
	public List<SysTerm> getRoleMune(SysTerm term) {
		/*StringBuffer sql = new StringBuffer();
		url = url+"%";
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getRoleMune"));
		List<SysTerm> list =jdbcTemplate.query(sql.toString(), new Object[]{uid,
			url
		},new BeanPropertyRowMapper(SysTerm .class));
		return list;*/
		return selectList(MAPPER_NAMESAPCE+"getMenuAll",term);
	}

	@Override
	public int insertLog(Log log) {
		/*StringBuffer sql = new StringBuffer(); 
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_insertLog"));
		   jdbcTemplate.update(sql.toString(), new Object[] {
			   log.getContentid(),log.getDescription(),log.getUid(),log.getRemark(),log.getState(),
			   log.getCategory(),log.getCreateuser(),log.getCreateuser()
		});*/
		return insert(MAPPER_NAMESAPCE+"insertCrmLog", log);
	}

	@Override
	public List<Log> getLogList(Log log) {
		/*StringBuffer sql = new StringBuffer();
	    List<Object> listParam = new ArrayList<Object>();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getLogList"));
		if(log.getCategory()!=null){
			listParam.add(log.getCategory());
			sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getLogListParam1"));
		}
		if(log.getContentid()!=null){
			listParam.add(log.getContentid());
			sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getLogListParam"));
		}
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getLogListParam2"));
		List<Log> list =jdbcTemplate.query(sql.toString(), listParam.toArray(),new BeanPropertyRowMapper(Log .class));
		return list;*/
		
		List<Log> list = selectList(MAPPER_NAMESAPCE+"getLogList",log);
		if (list != null && list.size() > 0) {
			list.get(0).setTotalResults((Integer)selectOne(MAPPER_NAMESAPCE+"getLogListCount", log));
		}
		
		return list;
		
	}

	@Override
	public City getCityContantsProvince(String name) {
		/*StringBuffer sql= new  StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getCityContantsProvince"));
		List<City> list =jdbcTemplate.query(sql.toString() ,new Object[]{name},new BeanPropertyRowMapper(City.class));
		return list!=null&&list.size()>0?list.get(0):null;*/
		return null;
	}

	@Override
	public Province getProvinceByName(String name) {
		/*StringBuffer sql= new  StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getProvinceByName"));
		List<Province> list =jdbcTemplate.query(sql.toString() ,new Object[]{name},new BeanPropertyRowMapper(Province.class));
		return list!=null&&list.size()>0?list.get(0):null;*/
		return null;
	}

	@Override
	public List<Announcement> getAnnouncements() {
		/*StringBuffer sql= new  StringBuffer();
		sql.append(XmlReader.readXml(Constants.SQLFileName,"SysDao_getAnnouncements"));
		List<Announcement> list =jdbcTemplate.query(sql.toString() ,new BeanPropertyRowMapper(Announcement.class));
		return list;*/
		return selectList(MAPPER_NAMESAPCE+"getAnnouncementList",null);
	}

	@Override
	public int insertAllTransLog(Log log) {
		return insert(MAPPER_NAMESAPCE+"insertAllTransLog", log);
	}

	@Override
	public List<Log> getCopyCount() {
		 return selectList(MAPPER_NAMESAPCE+"getCopyCount");
	}

	@Override
	public int addDepartment(Department d) {
		return insert(MAPPER_NAMESAPCE+"addDepartment", d);
	}

	@Override
	public List<Configure> getConfigureList(Configure c) {
		List<Configure> list = selectList(MAPPER_NAMESAPCE+"getConList", c);
		if (list != null && list.size() > 0) {
			list.get(0).setTotalResults((Integer)selectOne(MAPPER_NAMESAPCE+"getConListCount", c));
		}
		return list;
	}

	@Override
	public List<ConfigureItem> getConfigureItemList(ConfigureItem ci) {
		List<ConfigureItem> list = selectList(MAPPER_NAMESAPCE+"getConItemList", ci);
		if (list != null && list.size() > 0) {
			list.get(0).setTotalResults((Integer)selectOne(MAPPER_NAMESAPCE+"getConItemListCount", ci));
		}
		return list;
	}

	@Override
	public Integer getMaxOrderNumber(ConfigureItem ci) {
		return selectOne(MAPPER_NAMESAPCE+"getMaxOrderNumber", ci);
	}

	@Override
	public int addConfigure(Configure c) {
		return insert(MAPPER_NAMESAPCE+"addConfigure", c);
	}

	@Override
	public int addConfigureItem(ConfigureItem ci) {
		return insert(MAPPER_NAMESAPCE+"addConfigureItem", ci);
	}

	@Override
	public int deleteConfigure(Configure c) {
		return update(MAPPER_NAMESAPCE+"deleteConfigure", c);
	}

	@Override
	public int deleteConfigureItem(ConfigureItem ci) {
		return update(MAPPER_NAMESAPCE+"deleteConfigureItem", ci);
	}

	@Override
	public int updateConfigure(Configure c) {
		return update(MAPPER_NAMESAPCE+"updateConfigure", c);
	}

	@Override
	public int updateConfigureItem(ConfigureItem ci) {
		return update(MAPPER_NAMESAPCE+"updateConfigureItem", ci);
	}

	@Override
	public int deleteDepartment(Long id) {
		return update(MAPPER_NAMESAPCE+"deleteDepartment", id);
	}

	@Override
	public List<Department> getDeptListByPid(Long parentid) {
		return selectList(MAPPER_NAMESAPCE+"getDeptListByPid", parentid);
	}

	@Override
	public int updateDepartment(Department d) {
		return update(MAPPER_NAMESAPCE+"updateDepartment", d);
	}

	@Override
	public int getDtSonCountByPid(Long pid) {
		return selectOne(MAPPER_NAMESAPCE+"getDtSonCountByPid", pid);
	}

	@Override
	public List<CallLog> getCallLogList(CallLog cl) {
		List<CallLog> list = selectList(MAPPER_NAMESAPCE+"getCallLogList",cl);
		if (list != null && list.size()>0) {
			list.get(0).setTotalResults((Integer)selectOne(MAPPER_NAMESAPCE+"getCallLogListCount", cl));
		}
		return list;
	}

	@Override
	public int insertCallLog(CallLog cl) {
		return insert(MAPPER_NAMESAPCE+"insertCallLog", cl);
	}

	@Override
	public List<CallLog> getUpdCallLogList() {
		return selectList(MAPPER_NAMESAPCE+"getUpdCallLogList");
	}

	@Override
	public int updateCallLog(CallLog cl) {
		return update(MAPPER_NAMESAPCE+"updateCalllog", cl);
	}

	@Override
	public int getCallLogData(CallLog cl) {
		return selectOne(MAPPER_NAMESAPCE+"getCallLogListCount", cl);
	}

	@Override
	public int getCallLogTimeTotal(CallLog cl) {
		return  selectOne(MAPPER_NAMESAPCE+"getCallLogTimeTotal", cl);
	}

	@Override
	public List<CallLog> getTimesUserCallLogList() {
		return  selectList(MAPPER_NAMESAPCE+"getTimesUserCallLogList");
	}

	@Override
	public int getCallLogCountByCode(CallLog cl) {
		return selectOne(MAPPER_NAMESAPCE+"getCallLogCountByCode", cl);
	}
	
}
